package com.tywj.navigation.map

import com.amap.api.services.core.PoiItem
import com.tywj.panda.customer.common.widget.recyclerview.MyBaseAdapter
import com.tywj.lib.core.widget.recycleview.adapter.BaseViewHolder
import com.tywj.navigation.R
import java.lang.StringBuilder

/**
 * 搜索地址列表适配器
 */
class NavigationAddressAdapter : MyBaseAdapter<PoiItem>(R.layout.navigation_recycleview_item_address) {

    override fun convert(helper: BaseViewHolder, item: PoiItem) {
        super.convert(helper, item)

        helper.setText(R.id.tvMainAddress, item.title)
        helper.setText(
            R.id.tvDetailAddress,
            StringBuilder().append(item.provinceName).append(item.cityName).append(item.snippet)
        )
    }
}